-- story_world.lua - 修仙游戏世界探索相关故事

return {
    -- 村长来访节点
    {
        id = "village_visit",
        title = "村长来访",
        text = [[村长告诉你，最近村里经常有野兽出没，希望你能帮忙解决。
作为村里唯一的修仙者，你义不容辞。]],
        vars = {
            ["game.quest"] = "kill_beasts",
            ["game.score"] = function(state)
                return (state.variables["game.score"] or 0) + 5
            end
        },
        choices = {
            {
                text = "答应村长的请求",
                next = "accept_quest"
            },
            {
                text = "委婉拒绝",
                next = "refuse_quest"
            },
            {
                text = "询问更多详情",
                next = "ask_quest_details"
            }
        }
    },
    
    -- 假装不在家节点
    {
        id = "pretend_absent",
        title = "逃避现实",
        text = [[你假装不在家，村长和村民们离开了。
你知道这样做不对，但你还没有准备好面对他们。]],
        vars = {
            ["game.coward"] = true,
            ["game.score"] = function(state)
                return (state.variables["game.score"] or 0) - 10
            end
        },
        choices = {
            {
                text = "出去找村长道歉",
                next = "apologize_to_village_chief"
            },
            {
                text = "继续隐藏",
                next = "continue_hiding"
            }
        }
    },
    
    -- 山林探索节点
    {
        id = "mountain_forest",
        title = "山林深处",
        text = [[你进入了山林深处，这里的树木更加茂密。
你听到了一些奇怪的声音，可能是野兽的叫声。]],
        vars = {
            ["game.location"] = "mountain_forest",
            ["game.score"] = function(state)
                return (state.variables["game.score"] or 0) + 5
            end
        },
        choices = {
            {
                text = "追踪声音来源",
                next = "track_sound"
            },
            {
                text = "寻找草药",
                next = "find_herbs"
            },
            {
                text = "返回村庄",
                next = "village_outside"
            }
        }
    },
    
    -- 与村民交谈节点
    {
        id = "talk_to_villagers",
        title = "村民的担忧",
        text = [[你和村民们交谈，他们告诉你最近村里确实不太平。
有村民在山上看到了体型巨大的野兽，还有人失踪了。]],
        vars = {
            ["game.quest_info"] = "beast_info",
            ["game.score"] = function(state)
                return (state.variables["game.score"] or 0) + 5
            end
        },
        choices = {
            {
                text = "去山上调查",
                next = "mountain_forest"
            },
            {
                text = "去村长家",
                next = "village_chief_house"
            },
            {
                text = "回家修炼",
                next = "start_cultivation"
            }
        }
    },
    
    -- 药铺购买节点
    {
        id = "buy_herbs",
        title = "购买草药",
        text = [[王伯向你推荐了几种适合练气期修士使用的草药。
'这些草药可以帮助你恢复灵气，提升修炼速度。']],
        vars = {
            ["game.location"] = "apothecary",
            ["game.score"] = function(state)
                return (state.variables["game.score"] or 0) + 3
            end
        },
        choices = {
            {
                text = "购买补气丹（5金币）",
                next = "buy_qi_pill"
            },
            {
                text = "购买疗伤药（3金币）",
                next = "buy_healing_pill"
            },
            {
                text = "不买了，谢谢",
                next = "village_outside"
            }
        }
    },
    
    -- 询问修仙相关节点
    {
        id = "ask_about_cultivation",
        title = "关于修仙",
        text = [[王伯告诉你，他年轻的时候也见过修仙者。
'修仙之路充满艰辛，但也有着无限可能。'
他还提到附近有一个修仙门派，叫做青玄宗。]],
        vars = {
            ["game.sect_info"] = "qingxuan",
            ["game.score"] = function(state)
                return (state.variables["game.score"] or 0) + 10
            end
        },
        choices = {
            {
                text = "询问青玄宗的位置",
                next = "ask_sect_location"
            },
            {
                text = "购买一些草药",
                next = "buy_herbs"
            },
            {
                text = "离开药铺",
                next = "village_outside"
            }
        }
    },
    
    -- 村里的书店节点
    {
        id = "village_bookstore",
        title = "古老书店",
        text = [[你发现村里有一家不起眼的书店。
书店老板是一位慈祥的老人，他告诉你这里有一些关于修仙的书籍。]],
        vars = {
            ["game.location"] = "bookstore",
            ["game.score"] = function(state)
                return (state.variables["game.score"] or 0) + 5
            end
        },
        choices = {
            {
                text = "购买《修仙入门》（8金币）",
                next = "buy_basic_book"
            },
            {
                text = "询问有没有更高级的书籍",
                next = "ask_advanced_books"
            },
            {
                text = "离开书店",
                next = "village_outside"
            }
        }
    }
}